package com.xinongbest.reader.task;

import com.xinongbest.reader.service.BookService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author lemonwan
 * <h1>定时计算任务</h1>
 */
@Component
public class ComputeTask {

    private BookService bookService;

    /**
     * <h2>定时任务，每分钟执行更新操作</h2>
     */
    @Scheduled(cron = "0,40 * * * * ?")
    public void updateEvaluation() {
        bookService.selectById(1L);
        System.out.println("定时任务已经执行");
    }
}
